from industrialai.db import api as db_api
from pecan import hooks


class DBHook(hooks.PecanHook):
    # Create a db connection instance.
    def before(self, state):
        state.request.db_conn = db_api.Connection()
